#include "stdafx.h"
#include "common.h"
#include "os.h"

namespace os
{
	BOOL Is64bitSystem()
	{
		SYSTEM_INFO si;
		GetNativeSystemInfo(&si);

		if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ||
			si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64)
		{
			return TRUE;
		}
		else
		{
			return FALSE;
		}
	}
	bool is_win7()
	{
		RTL_OSVERSIONINFOEXW os = {};
		os.dwOSVersionInfoSize = sizeof(os);
		auto ns = NTDLL::RtlGetVersion(reinterpret_cast<RTL_OSVERSIONINFOW*>(&os));
		if (NT_SUCCESS(ns))
		{
			if (os.dwMajorVersion == 6 && os.dwMinorVersion == 1)
			{
				return true;
			}
		}
		return false;
	}
};